package com.mxprojects.gui
{
	import flash.text.TextField;
	
	public class CategoryItem extends BaseForumElement
	{
		public var title:TextField;
				
		public function CategoryItem(title:String){
			//parse the CSS
			this.title.styleSheet = Styles.css;
			
			//set the values
			this.title.htmlText = "<span class=\"categoryTitle\">" + title + "</span>";
			
			//handle the defaults
			super.init(".categoryBackground");
		}
		
		override public function resize():void {
			super.resize();
			
			//get the forums under the category and resize those are well
			for(var i:int = 0; i < numChildren; i++){
				if(getChildAt(i) is ForumItem){
					var forum:ForumItem = getChildAt(i) as ForumItem;
					forum.resize();
				}
			}
		}
		
	}
}